﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;


public static class AppHelper
{
    /// <summary>
    /// return an absolute path to the Content Folder
    /// </summary>
    public static string ContentRoot
    {
        get
        {
            string contentVirtualRoot = "~/Content";
            return VirtualPathUtility.ToAbsolute(contentVirtualRoot);
        }
    }

    /// <summary>
    /// return an absolute path to the Image Folder
    /// </summary>
    public static string ImageRoot
    {
        get
        {
            return string.Format("{0}/{1}", ContentRoot, "Images");
        }
    }

    /// <summary>
    /// return an absolute path to the Css Folder
    /// </summary>
    public static string CssRoot
    {
        get
        {
            return string.Format("{0}/{1}", ContentRoot, "CSS");
        }
    }

    public static string JavaScriptRoot
    {
        get
        {
            return string.Format("{0}/{1}", ContentRoot, "JavaScript");
        }
    }

    /// <summary>
    /// return an Image URL
    /// </summary>
    /// <param name="imageName">the Name of the Image</param>
    /// <returns>an URL string</returns>
    public static string ImageURL(string imageName)
    {
        string imagePath = string.Format("{0}/{1}", ImageRoot, imageName);
        return imagePath;
    }

    /// <summary>
    /// return an CSS file URL
    /// </summary>
    /// <param name="fileName">the name of the CSS file</param>
    /// <returns>an URL string</returns>
    public static string CssURL(string fileName)
    {
        string filePath = string.Format("{0}/{1}", CssRoot, fileName);
        return filePath;
    }

    public static string JavaScriptURL(string fileName)
    {
        string filePath = string.Format("{0}/{1}", JavaScriptRoot, fileName);
        return filePath;
    }
}

